<template>
  <div>
    <h3>App根组件</h3>
    <hr>
    <button @click="flag=!flag">toggle</button>
    <life-cycle v-if="flag"></life-cycle>
  </div>
</template>

<script>
import LifeCycle from './LifeCycle.vue'
export default {
  name:'MyApp',
  components:{
    LifeCycle
  },
  data(){
    return{
      flag:true
    }
  }
}
</script>

<style lang="less" scoped>

</style>